<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="js/test.js" %>
<%@ include file="js/InfoHandler.js" %>
<%@ include file="js/Ajax.js" %>
<%@ include file="js/Post.js" %>


<%
    String parentPath = request.getParameter("parentPath");
    String products[] = {"-Select One-","ESB","GReg","IS","BAM","GS","BPS","MS","DSS","WSAS","WSF"};
/*
     String ESB[] = {"2.1.3","2.1.2","2.1.1","2.1.0","2.0.2","2.0.1","2.0"};
     String GReg[] = {"3.0.3","3.0.2","3.0.1","3.0.0","2.0"};
     String IS[] = {"2.0.3","2.0.2","2.0.1","2.0.0"};
     String BAM[] ={"1.0.1"};
     String GS[] = {"1.0.1"};
     String BPS[] = {"1.1.1","1.1.0","1.0.1","1.0"};
     String MS[] = {"2.0.2","2.0.1","2.0.0","1.5.2"};
     String DSS[] = {"2.2.1","2.2.0","2.0.0","1.0.1"};
     String WSAS[] = {"3.1.3","3.1.2","3.1.1","3.0.1","3.0"};
*/
     String cP[] = {"-Select One-","2.0.3","2.0.2","2.0.1","2.0.0"};
     String jdkP[] = {"-Select One-","1.6","1.5"};
    %>

<script type="text/javascript">
    var jsParentPath = "<%=parentPath%>";  
    //TODO validate sPath
</script>

<br/>
<input type="hidden" id="sPath" name="sPath" value=""/>
<!--
<form id="diaAddForm" action="../registry/custom/dia/dia_add_handler_ajaxprocessor.jsp" onsubmit="Post.Send(this); showHideCommon('otherData'); return false;" method="post">
-->
    <form id="diaAddForm" action="../registry/custom/dia/dia_add_handler_ajaxprocessor.jsp"  method="get">
    <input type="hidden" name="parentPath" value="<%=parentPath%>"/>
    <input type="hidden" name="numOfAsso" id="numOfAsso" value="0"/>
    <table style="width:100%"  cellpadding="0" cellspacing="0" border="0" class="styledLeft">
            <thead>
                    <tr>
                            <th colspan="2">
    <strong>Add a new External Documentation</strong>
    </th>
        </tr>
            </thead>
            <tbody>
        <tr>
            <td class="leftCol-med">Title <span class="required">*</span></td>
            <td><input type="text" id="diaTitle" name="diaTitle"/></td>
        </tr> 
        <tr>
            <td>Summary</td>
            <td><textarea name="diaSummary" rows="4" cols="20"></textarea></td>
        </tr>
        <tr>
            <td>External Link <span class="required">*</span></td>
            <td><input type="text" name="diaLink"/></td>
        </tr>
<!--
        <tr>
            <%--<td><input type="button" value="Save" onclick="submitCustomAddUIForm('diaAddForm', '../registry/custom/topics/dia_add_handler_ajaxprocessor.jsp')"/></td>--%>
            <td colspan="2" class="buttonRow"><input class="button" type="submit" value="Create"/></td>
        </tr>
-->

<tr>
        <td>Relevant Product</td>
                <td> 
                <div id="pID" >
                <table cellpadding="0" cellspacing="0" border="0" class="styledLeft">

                    <tbody>
                        <tr>
                        <td>Product</td>
                        <td>
                        <select id="product" name="product">
                        <%
                        for(int i=0; i< products.length; i++){
                            String name1 = products[i];
                            %>
                            <option value="<%= name1%>"><%= name1%></option>
                            <%
                        }
                        %>
                        </select>
                        </td>
                        </tr>
                       <tr>
                        <td>Product Release</td>
                        <td><input type="text" name="productRelease" id="productRelease"/></td>
                        </tr>

                    </tbody>
                </table>
                </div>
                </td>


    </tr>
    <tr>
        <td>Environment</td>

                <td> 
                <div id="eID">
                <table cellpadding="0" cellspacing="0" border="0" class="styledLeft">
                    <tbody>
                        <tr>
                        <td>Carbon Platform</td>
                        <td>
                        <select id="carbonPlatform" name="carbonPlatform">
                        <%
                        for(int i=0; i< cP.length; i++) {
                            String name1 = cP[i];
                            %>
                            <option value="<%= name1%>"><%= name1%></option>
                            <%
                        }
                        %>
                        </select>
                        </td>
                        </tr>
                        <tr>
                        <td>JDK Platform</td>
                        <td>
                        <select id="jdkPlatform" name="jdkPlatform">
               sdsd         <%
                        for(int i=0; i< jdkP.length; i++) {
                            String name1 = jdkP[i];
                            %>
                            <option value="<%= name1%>"><%= name1%></option>
                            <%
                        }
                        %>
                        </select>
                        </td>
                        </tr>

                    </tbody>
                </table>
                </div>
                </td>
    </tr>
    <tr>
        <td class="leftCol-med">Related Documentations</td> 
        <td> 
        <div id="diaAddAsso"> 
            <table cellpadding="0" cellspacing="0" border="0" class="styledLeft">
 
                <tr>
                <td>Path <span class="required">*</span></td>
                <td>
                    <input type="text" name="aPath0" id="aPath0" value="http://a" />
                    <input type="button" class="button" value=".." title="Resource Tree" onclick="showResourceTree('aPath0');">
                </td>
                </tr> 
                </table>
            <HR>
        </div>

    <div class="icon-link-ouside registryWriteOperation" class="box1-mid" >
        <a class="icon-link registryWriteOperation" style="background-image:url(../admin/images/add.gif);" onclick="addAssoTable();">
            Add Another Related Documentation
        </a>
    </div>
    <div>
</div> 
</td>
</tr>

    <tr>
           <td>Tags</td>
          <!--  <td><i nput type="te xt" name="diaTags" id="diaTags"/></td> -->
      <td>
          <div style="height: auto;" id="diaAddTags" class="info-area"> <!-- class="box1-mid">-->

            <div id="diaTagAddDiv" class="icon-link-ouside registryWriteOperation" >
                <a onclick="javascript:showHideCommon('diaTagAddTable');if($('diaTagAddTable').style.display!='none')$('diaTags').focus();" style="background-image: url(../admin/images/add.gif);" class="icon-link registryWriteOperation">
                    Add Tags
                </a>
            </div>
            <div  id="diaTagAddTable" class="registryWriteOperation" style="margin-top: 10px; ">
                <input type="text" name="diaTags" id="diaTags">
                <div style="font-style: italic; margin-top: 5px;">
                    <img alt=" " style="margin-right: 5px;" src="../info/images/help-small.jpg">
                    Use commas ("one, two") to add multiple tags.
                </div> 
            </div>
      </div>
      </td>
        </tr>
<!--
        <tr>
            <%--<td><input type="button" value="Save" onclick="submitCustomAddUIForm('diaAddForm', '../registry/custom/topics/dia_add_handler_ajaxprocessor.jsp')"/></td>--%>
            <td colspan="2" class="buttonRow"><input class="button" type="button" value="Done" onclick="window.location.href='https://localhost:9443/carbon/resources/resource.jsp?path='+document.getElementsByName('sPath')[0].value"/></td>

        </tr>
-->
        <tr>
            <%--<td><input type="button" value="Save" onclick="submitCustomAddUIForm('diaAddForm', '../registry/custom/topics/dia_add_handler_ajaxprocessor.jsp')"/></td>--%>
            <td colspan="2" class="buttonRow"><input class="button" type="submit" value="Add Documentation"/></td>
        </tr> 
    </tbody>
    </table>
</form> 
        